package complexity;

public class Selection {
    public static void selectSort(Comparable[] arr){
        for (int i = 0; i < arr.length-1; i++) {
            int minIndex = i;
            for (int j = i; j < arr.length; j++) {
                if (Bubble.greater(arr[minIndex],arr[j])){
                    minIndex=j;
                }
            }
            Bubble.exChange(arr,i,minIndex);
        }
    }
}
